#include <iostream>
using namespace std;
int A[]={1,1,0,0,1};
int B[]={0,1,1,0,0};

bool printArray(int array[],int size)
{
	if(size>0)
	{
		for(int i=0;i<size;i++)
		{
			if(array[i]==0||array[i]==1)
				cout<<array[i]<<",";
			else
				return false;
		}
		cout<<endl;
		return true;
	}
	else
	{
		cout<<"Damn,give me a correct array please"<<endl;
		return false;
	}
	
	
	
}
int main (int argc, char * const argv[]) {
    int size=(sizeof(A)/sizeof(int));
	if((sizeof(B)/sizeof(int))!=size)
	{
		cout<<"Damn,give me two same size binary arrays please"<<endl;
		return 1;
	}
	if(!printArray(A,size)||!printArray(B,size))
	{
		cout<<"Damn,give me an binary arrays please"<<endl;
		return 1;
	}
	
	int C[size+1];
	int carry=0;
	for (int i=size;i>0;i--)
	{
		int sum=A[i-1]+B[i-1]+carry;
		C[i]=sum%2;
		carry=sum/2;
	}
	C[0]=carry;
	if(!printArray(C,size+1))
	{
		cout<<"Damn,it is Eric mistake"<<endl;
		return 1;
	}
    return 0;
}
	